<?php


/**
 * 门店提问详情
 * Class ListAction
 */
class AskDetailAction extends ActionPlugin
{
    public const USER_LEVEL = self::LEVEL_NOTHING;

    /**
     * @throws Exception
     */
    public function main()
    {
        $storeId = $this->getPost('store_id', 0);
        $questionId = $this->getPost('question_id', 0);
        $uid = $this->uid;

        $rs = \Biz\service\Store\StoreAskService::storeAskDetail((int)$questionId, (int)$uid);
//        $data = [
//            'store_id' => 1,
//            'question_id' => 1,
//            'question' => '这个空调是变频的吗？',
//            'addtime' => '2021.03.20',
//            'nick' => '小葡萄和行行',
//            'num' => '2',
//            'avatar_small' => 'https://img.haohaozhu.cn/Pic-imageShow/sq_small/0000bjcp?iv=1&v=9',
//            'answer_list' => [
//                [
//                    'answer_id' => 50,
//                    'nick' => '小葡萄和行行',
//                    'avatar_small' => 'https://img.haohaozhu.cn/Pic-imageShow/sq_small/0000bjcp?iv=1&v=9',
//                    'answer' => '这个空调是变频的吗？',
//                    'addtime' => '2021.03.20 09:28:31',
//                    'like' => 1,
//                    'like_num' => 23,
//                ],
//                [
//                    'answer_id' => 51,
//                    'nick' => '小葡萄和行行',
//                    'avatar_small' => 'https://img.haohaozhu.cn/Pic-imageShow/sq_small/0000bjcp?iv=1&v=9',
//                    'answer' => '这个空调是变频的吗？',
//                    'addtime' => '2021.03.20 09:28:31',
//                    'like' => 0,
//                    'like_num' => 50,
//                ],
//            ],
//        ];
//
//        $this->setSuccess($data + ['develop' => $rs]);

        \Doraemon\tools\ActionLog::log($this->uid, [
            'question_id' => $questionId,
            'uid' => $uid,
        ], \Doraemon\tools\ActionLog::STORE_ASK_DETAIL);

        $this->setSuccess($rs);
    }

}